const components = import.meta.glob('../components/*.vue', {
  eager: true, // 非懒加载
  import: 'default', // 直接拿到default中的数据
})

export default {
  install(app) {
    Object.entries(components).forEach(item => {
      const [path, component] = item
      const name = path.replace('../components/', '').replace('.vue', '')
      app.component(`App${name}`, component)
    })
  },
}
